﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Cdn.Blogger.Models
{
    public class RestCall
    {
        public string MyDomain { get; set; }
        public string RequestDomain { get; set; }
        public string Content { get; set; }
        public string ContentType { get; set; }
        public string RequestUrl { get; set; }
        public RestCall()
        {
            var Request = HttpContext.Current.Request;
            if (Request != null)
            {
                Content = string.Empty;
                ContentType = "text/html";
                //Would be different
                RequestDomain = Request.Url.Scheme + "://" + Request.Url.DnsSafeHost + (Request.Url.IsDefaultPort ? "" : ":" + Request.Url.Port);
                MyDomain = Request.Url.Scheme + "://" + Request.Url.DnsSafeHost + (Request.Url.IsDefaultPort ? "" : ":" + Request.Url.Port);
                RequestUrl = Request.Url.AbsoluteUri;
            }
        }
    }
}